
//Copyright 1997-2009 Syrinx Development, Inc.
//This file is part of the Syrinx Web Application Framework (SWAF).
// == BEGIN LICENSE ==
//
// Licensed under the terms of any of the following licenses at your
// choice:
//
//  - GNU General Public License Version 3 or later (the "GPL")
//    http://www.gnu.org/licenses/gpl.html
//
//  - GNU Lesser General Public License Version 3 or later (the "LGPL")
//    http://www.gnu.org/licenses/lgpl.html
//
//  - Mozilla Public License Version 1.1 or later (the "MPL")
//    http://www.mozilla.org/MPL/MPL-1.1.html
//
// == END LICENSE ==
using System;
using System.Xml;
	
namespace Swaf.BizObj
{
	/// <summary>
	/// Defines how to access and manipulate a list of business objects that acts like an enumerator.
	/// </summary>
	/// <remarks>
	/// This interface is similar in concept to .NET IEnumerators or Java iterators but is more
	/// powerful.  It also represents a stable definition of how to iterate through a list of business
	/// objects accross.</remarks>
	public interface IBizObjCursor : ICloneable
	{
		/// <summary>
		/// True if the cursor has gone past the last element in the list this cursor is attached to.
		/// </summary>
		bool eof{get;}

		/// <summary>
		/// True if the cursor has moved before the first element in the list this cursor is attached to.
		/// </summary>
		bool bof{get;}

		/// <summary>
		/// The number of elements in the bizobj list this cursor is attached to.
		/// </summary>
		int numElements{get;}

		/// <summary>
		/// The bizobj list this cursor was created from and attached to.
		/// </summary>
		IBizObjList Source{get;}

		/// <summary>
		/// The bizobj that the cursor is currently pointing to in the bizobj list.  If bof or eof are true
		/// this will return null.
		/// </summary>
		IBizObj currentElement{get;}

		/// <summary>
		/// represents the current position of the cursor in the bizobj list.  If bof or eof are true
		/// this value will be -1.
		/// </summary>
		int currentPosition{get;}

		/// <summary>
		/// Positions the cursor to the first element in the bizobj list.  If the list is empty, both bof
		/// and eof will be true.
		/// </summary>
		void  moveFirst();

		/// <summary>
		/// Positions the cursor to the next element in the bizobj list.  If eof is already true, this method
		/// will throw an exception.
		/// </summary>
		void  moveNext();
		
		/// <summary>
		/// Positions the cursor the the previous element in the bizobj list.  If bof is already true, this
		/// method will throw an exception.
		/// </summary>
		void  movePrevious();

		/// <summary>
		/// Positions the cursor to the last element in the bizobj list.  If the list is empty, both bof and eof
		/// will be true.
		/// </summary>
		void  moveLast();

		/// <summary>
		/// Positions the cursor to the bizobj at the given pos.
		/// </summary>
		/// <param name="pos">The index in the bizobj list to position to.  If pos is out of
		/// range an exception will be thrown.</param>
		void  moveTo(int pos);

	}


}